<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
$this->load->view('logged_in/admin/header', array('current_page' => 0));

?>
	<!-- Main Wrapper -->

	<div id="main-wrapper">
		<div class="container">

			<div class="row">
				<?php $this->load->view('logged_in/admin/panel'); ?>

				<div class="8u skel-cell-important">
					<div>
						<h4 style="color: #ff3918"><?php echo $error; ?></h4>
					</div>
					<!-- Content -->
					<form name="frmEdit" id="frmEdit" action="" method="post" enctype="multipart/form-data">
						<div id="content" style="text-align: center;">
							<div class="10u input-group input-group-lg" style="margin: 0 auto;">
								<span class="input-group-addon">Title</span>
								<input type="text" name="title" class="form-control" value="<?php echo $article['title'] ?>">
							</div>

							<div class="10u" style="width: 40%; margin: 1em auto; margin-top: 2em">
								<?php if ($article['image'] != '')
									echo '<img style="width: 100%; border-radius: 5px; display: " src="' . base_url() . 'images/article_image/' . $article['image'] . '">';
								?>
							</div>
							<div class="8u input-group" style="margin: 1em auto;">
								<input id="uploadFile" class="form-control" placeholder="Change Image" disabled="disabled"/>

								<div class="input-group-addon btn-lg fileUpload btn btn-primary"
								     style=" position: relative; overflow: hidden; background-color: #5cb85c; border-color: #4cae4c; color: #ffffff">
									<span>Upload</span>
									<input id="uploadBtn" name="image" type="file" class="upload"
									       style="position: absolute; top: 0; right: 0; margin: 0; padding: 0; font-size: 20px; cursor: pointer; opacity: 0; filter: alpha(opacity=0);"
									       onchange='document.getElementById("uploadFile").value = this.value;'/>
								</div>
							</div>
							<div class="panel panel-default">
								<div class="panel-heading" style="padding: 0;">
									<h3 class="panel-title fa fa-file-text" style="margin: 0 1em;">Content</h3>
								</div>
								<input class="content" name="content" value='<?php echo $article['content']; ?>'/>
							</div>
							<button type="submit" name="btn_edit"
							        class="btn-lg btn-primary"
							        style=" margin: 0 auto; padding: 0.5em 1em; margin-top: 1em; font-size: 1.35em; font-weight: bold;"> <i class="fa fa-save" style="margin-right: .5em"></i>Save</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
	<script>

		tinymce.init({
			height: 300,
			selector: 'input.content'
		});
	</script>
<?php
$this->load->view('logged_in/components/footer');
?>